package me.snowiest.snowdrift.advice;

import me.snowiest.snowdrift.vo.CommonResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public CommonResult ExceptionHandler(Exception e) {
        e.printStackTrace();
        return CommonResult.fail().message("发生全局异常");
    }
}
